package com.qst.control;

import com.qst.service.UserInfoManagerService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@WebServlet("/getUserInfoes")
public class GetUserInfoServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        UserInfoManagerService service=new UserInfoManagerService();
//        调用业务逻辑层获取用户列表信息
        List<Map<String,Object>> lm=service.getUserInfoes();
//        将用户信息存放在session中
        req.getSession().setAttribute("userinfoes",lm);
//        转发到用户管理页面
        req.getRequestDispatcher("userInfoManager.jsp").forward(req,resp);

    }
}
